<?php


/**
 * graf ktory je zadany pomocou matice tak ze kluc je id vrchola a hodnota je pole ideciek vrcholov s ktorymi je susedny
 * ak nema ziadneho suseda treba dat array(), pretoze inak by sa to tvarilo ako graf bez tohto vrchola,
 * co vlastne ani tak nevadi pretoze robime spojity graf
 * 
 * @example $matrix = array(
 *		1 => array(2),
 *		2 => array(1, 3, 4, 7, 9, 10),
 *		3 => array(2, 4),
 *		4 => array(2, 3, 5, 6, 9, 10),
 *		5 => array(4, 7, 8),
 *		6 => array(4),
 *		7 => array(2, 5, 8, 9),
 *		8 => array(5, 7, 9),
 *		9 => array(2, 4, 7, 8),
 *		10 => array(2, 4),
 *	);
 * 
 */
class UserGraph extends Graph
{
	protected $matrix = null;
	protected $type = 5;
	
	public function __construct($array)
	{
		
		foreach ($array as $row => $values)
		{
			foreach ($values as $column)
			{
				$this->matrix[$row][$column] = 1;
			}
		}
		
		parent::__construct(count($array));
	}
	
	/**
	 * overridnuta metoda na generovanie matice, pretoze maticu spravime uz v konstruktore
	 *
	 */
	protected function generateMatrix()
	{
		
	}
}

?>